package result

var (
	CodeMsg200  = codeMsg(200, "操作成功！")
	CodeMsg500  = codeMsg(500, "操作失败！")
	CodeMsg400  = codeMsg(400, "参数不正确！")
	CodeMsg401  = codeMsg(401, "token不能为空！")
	CodeMsg402  = codeMsg(402, "token无效！")
	CodeMsg403  = codeMsg(403, "token已过期！")
	CodeMsg1000 = codeMsg(1000, "两次密码不一致！")
	CodeMsg1001 = codeMsg(1001, "用户名已存在！")
	CodeMsg1002 = codeMsg(1002, "用户注册失败！")
	CodeMsg1003 = codeMsg(1003, "用户登录失败！")
	CodeMsg1004 = codeMsg(1004, "用户名不存在！")
	CodeMsg1005 = codeMsg(1005, "密码不正确！")
	//LOGIN_UNKNOWN = codeMsg(202, "用户不存在")
	//LOGIN_ERROR   = codeMsg(203, "账号或密码错误")
	//VALID_ERROR   = codeMsg(300, "参数错误")
	//OPTIONS_ERROR = codeMsg(400, "操作失败")
	//UNAUTHORIZED  = codeMsg(401, "您还未登录")
	//NOT_FOUND     = codeMsg(404, "资源不存在")
	//SYSTEM_ERROR  = codeMsg(500, "系统发生异常")
)

func codeMsg(code int, msg string) *Result {
	return &Result{
		Code: code,
		Msg:  msg,
	}
}

//func (e *Result) Error() string {
//	return e.Msg
//}
//
//func (e *Result) GetError(data interface{}) *Result {
//	return &Result{
//		Msg:  e.Msg,
//		Code: e.Code,
//		Data: data,
//	}
//}
